package com.sc.nft.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.UserEcologyHatchRecords;
import com.sc.nft.entity.UserInfo;
import com.sc.nft.entity.dto.EcologyHatchCountDTO;
import com.sc.nft.entity.vo.HatchCountVO;
import com.sc.nft.entity.vo.MyPointsDetailsVO;
import com.sc.nft.entity.vo.PageHatchRecordsVO;
import com.sc.nft.entity.vo.UserEcologyUsableUpperLimitPageVO;
import com.sc.nft.entity.vo.ecology.*;

import java.util.List;

public interface EcologySmeltingService {

    /**
     * 生态熔炼的首页
     *
     * @param user
     * @return
     */
    HatchHomeVO hatchHome(UserInfo user);

    /**
     * 熔炼列表
     *
     * @param user
     * @param pageNo
     * @param pageSize
     * @return
     */
    Page<HatchPageVO> hatchPage(UserInfo user, Integer pageNo, Integer pageSize, Long userCreatorId);

    /**
     * 获取奖励
     *
     * @param id
     * @param hatchCount
     * @param user
     * @return
     */
    HatchRewardsSummaryVO preHatchRewards(Long id, Long methodId, Integer hatchCount, UserInfo user);

    /**
     * 熔炼/孵化
     *
     * @param id
     * @param hatchCount
     * @param user
     */
    void hatch(Long id, Long methodId, Integer hatchCount, UserInfo user);

    /**
     * 分页获取孵化记录
     *
     * @param pageNo
     * @param pageSize
     * @param user
     * @return
     */
    Page<PageHatchRecordsVO> pageHatchRecords(Integer pageNo, Integer pageSize, UserInfo user);

    /**
     * 获取孵化记录的奖励详情
     *
     * @param user
     * @param userEcologyHatchRecordsId
     * @return
     */
    HatchRecordsDetailsVO hatchRecordsDetails(UserInfo user, Long userEcologyHatchRecordsId);

    /**
     * 我的信息
     *
     * @param user
     * @return
     */
    MyRrewVO myRrew(UserInfo user);

    /**
     * 我的下级熔炼记录
     *
     * @param user
     * @return
     */
    Page<JunioRecologyHatchRecords> myJunioRecologyHatchRecords(UserInfo user, Integer pageNo, Integer pageSize);

    /**
     * 我的积分详情
     *
     * @param user
     * @return
     */
    MyPointsDetailsVO myPointsDetails(UserInfo user);

    /**
     * 分页获取我的燃料记录
     *
     * @param user
     * @param type
     * @param pageNo
     * @param pageSize
     * @return
     */
    Page<MyPointsRecordsVO> myPointsRecords(UserInfo user, Integer type, Integer pageNo, Integer pageSize);


    /**
     * 熔炼之后 额度收益处理
     *
     * @param userId
     */
    void quotaIncome(Long userId);

    /**
     * 熔炼之后 分成处理
     *
     * @param userEcologyHatchRecords
     */
    void divideInto(UserEcologyHatchRecords userEcologyHatchRecords);

    /**
     * 熔炼之后 分成处理(新)
     *
     * @param userEcologyHatchRecords
     */
    void newDivideInto(UserEcologyHatchRecords userEcologyHatchRecords);

    /**
     * 熔炼之后 结算业绩
     *
     * @param userEcologyHatchRecords
     */
    void settlePerformance(UserEcologyHatchRecords userEcologyHatchRecords);

    /**
     * 获取熔炼上限
     */
    EcologyHatchCountDTO getUserHatchCount(Long userId, Long id);

    /**
     * 获取用户熔炼剩余次数
     *
     * @param id
     * @param user
     * @return
     */
    HatchCountVO getHatchCount(Long id, UserInfo user);

    /**
     * 获取用户可用额度记录明细
     *
     * @param user
     * @param pageNo
     * @param pageSize
     * @return
     */
    Page<UserEcologyUsableUpperLimitPageVO> userEcologyUsableUpperLimitPage(UserInfo user, Integer pageNo, Integer pageSize);

    void remainingRewardsCountToUsableCountScript();
}
